package com.huaxin.hxcloud.work;

import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.support.v7.widget.Toolbar;
import android.text.Html;
import android.text.method.ScrollingMovementMethod;
import android.widget.TextView;

import com.huaxin.common.BaseActivity;
import com.huaxin.common.Constants;
import com.huaxin.common.utils.Util;
import com.huaxin.hxcloud.R;

import butterknife.BindView;

/**
 * @author lwjing
 * @date 2018/5/25
 * @Desc 力鼎预案内容查看
 * Copyright HUAXIN DATA. All rights reserved.
 */
public class HxLDReadContentActivity extends BaseActivity {
    @BindView(R.id.toolbar)
    Toolbar  mToolbar;
    @BindView(R.id.tv_content)
    TextView tv_content;
    private String title;
    private String content;

    public static void start(Context context,String content,String title){
        Intent intent=new Intent(context,HxLDReadContentActivity.class);
        intent.putExtra(Constants.TITLE_KEY,title);
        intent.putExtra(Constants.IK_PLAN_CONTENT,content);
        context.startActivity(intent);
    }
    @Override
    protected void getBundleExtras(Bundle extras) {
        title = extras.getString(Constants.TITLE_KEY);
        content = extras.getString(Constants.IK_PLAN_CONTENT);
    }

    @Override
    protected int getContentViewId() {
        return R.layout.act_ldplan_read_content;
    }

    @Override
    protected int getLoadFrameId() {
        return super.getLoadFrameId();
    }

    @Override
    public void initView() {
        setSupportActionBar(mToolbar);
        mToolbar.setTitle(title);
        if (Util.checkNull(content)){
            tv_content.setText("");
        }else{
            tv_content.setText(Html.fromHtml(content));
        }
        tv_content.setMovementMethod(new ScrollingMovementMethod(){

        });
    }

    @Override
    protected void requestData() {

    }

}
